<template>
  <div id="p">
    <div style="margin-top: 20px;">
      <p class="rightTag" style="top: 3cm;">白联仓库 红联财务 黄联客户</p>
      <span class="printHead">
        {{companyName}}{{jxQuarter}}客户配货单
      </span>
      <div class="info" style="height: 25px;">
        <p style="margin: 5px 0;">客户：{{name}}</p>
        <p style="margin: 5px 0;">配货序号：{{inputSequence}}</p>
      </div>
      <div class="info" style="height: 25px;">
        <p style="margin: 5px 0;">配货日期：{{inputDate}}</p>
      </div>
    </div>
    <table
      border="1" 
      align="center" 
      id="printTable">
      <tr>
        <td style="width: 4%;padding: 0;text-align: center;" rowspan="2">序号</td>
        <td style="width: 15%;padding: 0;text-align: center;" rowspan="2">型色</td>
        <td style="width: 8%;padding: 0;text-align: center;" rowspan="2">颜色</td>
        <td style="width: 15%;padding: 0;text-align: center;" rowspan="2">品名</td>
        <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">05</td>
        <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">07</td>
        <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">09</td>
        <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">11</td>
        <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">13</td>
        <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">15</td>
        <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">17</td>
        <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">19</td>
        <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">21</td>
        <td style="width: 3.8%;padding: 0;text-align: center;" nowrap="nowrap">23</td>
        <td style="width: 3.8%;padding: 0;text-align: center;">F</td>
        <td rowspan="2" style="text-align: center;width: 5%;">数量</td>
        <td rowspan="2" style="text-align: center;width: 5%;">售价</td>
        <td rowspan="2" style="text-align: center;">金额</td>
      </tr>
      <tr>
        <td style="text-align: center;border-top: 1px dotted;border-left: 1px dotted;">XS</td>
        <td style="text-align: center;border-top: 1px dotted;">S</td>
        <td style="text-align: center;border-top: 1px dotted;">M</td>
        <td style="text-align: center;border-top: 1px dotted;">L</td>
        <td style="text-align: center;border-top: 1px dotted;">XL</td>
        <td style="text-align: center;border-top: 1px dotted;">2L</td>
        <td style="text-align: center;border-top: 1px dotted;">3L</td>
        <td style="text-align: center;border-top: 1px dotted;">4L</td>
        <td style="text-align: center;border-top: 1px dotted;">5L</td>
        <td style="text-align: center;border-top: 1px dotted;">6L</td>
        <td style="text-align: center;border-top: 1px dotted;"></td>
      </tr>
    </table>
    <div class="info">
      <p style="margin: 5px 0;">操作员：{{operator}}</p>
      <p style="margin: 5px 0;">复核：</p>
      <p style="margin: 5px 0;">数量合计：{{printTotal}}</p>
      <p style="margin: 5px 0;">金额合计：{{printMoney}}</p>
    </div>
  </div>
</template>

<script>
export default {
  props: ['companyName','name','inputSequence','inputDate','operator','printTotal','printMoney'],
  data(){
    return {
      jxQuarter: null
      // jxQuarter: document.cookie.match(RegExp('jxQuarter'+'=([^;]+)'))[1]
    }
  },
  created(){
    let jxQuarterVal = document.cookie.match(RegExp('jxQuarter' + '=([^;]+)'))
    this.jxQuarter = jxQuarterVal ? jxQuarterVal[1] : null
  }
}
</script>

<style scoped>
  body {
    text-align: center;
  }
  *{
    margin: 0;
    padding: 0;
    font-family: 宋体;
  }
  table {
    border: 2px solid black;
    border-collapse: collapse;
    width: 97.3%;
    font-size: 14px;
    line-height: 25px;
    table-layout: fixed;
    text-align: center;
  }
  table tr:last-child td{
    text-align-last: left;
  }
  td {
    overflow: hidden;
  }
  td + td {
    border-left: 1px dotted;
  }
  .rightTag {
    position: absolute;
    right: 0;
    writing-mode: vertical-rl;
    margin: 0;
    height: 10cm;
  }
  .info{ 
    display: flex;
    justify-content: space-between;
    padding-right: 100px;
    font-size: 15px;
  }
  .printHead {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    border-bottom: 3px dotted;
    position: relative;
    transform: translateX(-50%);
  }
  #printA {
    page-break-after:always;
  }
  .addressH1{
    font-size: 20px;
  }
  .addressH2{
    font-size: 18px;
  }
  .addressH1, .addressH2{
    display: flex;
    justify-content: space-between;
    line-height: 40px;
    padding: 0 30px;
  }
</style>